﻿using MaximServices.Model;
using MaximServices.Repository;
using System;
using System.Collections.Generic;
using System.Text;

namespace MaximServices.Services
{
    public class ViewHistoryServices
    {
        private ViewHistoryRepository _viewHistoryRepository;
        public ViewHistoryServices(ViewHistoryRepository viewHistoryRepository)
        {
            _viewHistoryRepository = viewHistoryRepository;
        }

        public ViewHistory GetNow(DateTime date, string userId)
        {
            return _viewHistoryRepository.GetModelByNow(date, userId);
        }

        public List<ViewHistory> GetList(DateTime date, string userId)
        {
            DateTime start = new DateTime(date.Year,1,1);
            return _viewHistoryRepository.GetHistoryList(start, date, userId);
        }

        public bool AddHistory(ViewHistory model)
        {
            return _viewHistoryRepository.AddHistory(model);
        }
    }
}
